<template>
	<view class="page">
		<navbar backIconName="arrow-left" title="临时入企" :titleStyle="titleStyle"></navbar>
		<scroll-view class="scroll-view_H" scroll-y="true">
			<view :style="{height:statusHeight+'px'}"></view>
			<view class="inCompany-task" style="padding-top: 0px;">
				<view class="task-item" style="margin-top: 20rpx;" v-for="(item,index) in inCompanyList" :key="index">
					<view class="left">
						<view class="top">
							<text
								style="flex: 1; font-size: 28rpx;color: #1169DB;font-weight: bold;">{{'入企人员信息'+(index+1)}}
							</text>
							<view v-if="index != 0?true:false" class="clear-ico">
								<u-icon name="close"></u-icon>
							</view>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">姓名</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{item.lawEnforcerName || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">人员类型</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{item.personnelCategory || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">证件编号</text>
							<text style="flex: 1; font-size: 28rpx;color: #666666;">{{item.idNumber || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">所在单位</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{item.departmentName || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;border: none;">
							<text class="label-content">职务/职级</text>
							<text style="flex: 1; font-size: 28rpx;color: #666666;">{{item.post || '-'}}</text>
						</view>

					</view>

				</view>

			</view>
			<view class="inCompany-task">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">企业信息</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">企业名称</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{creditCompanyVo.companyName || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;align-items: center;">
							<view style="display: flex;flex-direction: column;">
								<text class="label-content">统一社会</text>
								<text class="label-content">信用代码</text>
							</view>

							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{creditCompanyVo.socialCreditNumber || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">所属行业</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{creditCompanyVo.industryType || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">联系人</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{creditCompanyVo.contacts || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;border: none;">
							<text class="label-content">联系电话</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{creditCompanyVo.contactNumber || '-'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;border: none;">
							<text class="label-content">地址</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{creditCompanyVo.addressName || '-'}}</text>
						</view>

					</view>

				</view>
			</view>

			<view class="inCompany-task" style="padding-top: 0px;">
				<view class="task-item">
					<view class="left">
						<view class="top">
							<text style="font-size: 28rpx;color: #1169DB;font-weight: bold;">入企信息</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">入企类型</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{formData.taskTypeName || '-'}}</text>
						</view>
						<u-line></u-line>
						<!-- <view class="top" style="padding-top: 20rpx;">
							<text class="label-content">计划入企日期</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{formData.enterprisePlanDate || '-'}}</text>
						</view>
						<u-line></u-line> -->
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">计划入企人数</text>
							<text style="flex: 1; font-size: 28rpx;color: #666666;">{{formData.numbers || '0'}}</text>
						</view>
						<u-line></u-line>
						<view class="top" style="padding-top: 20rpx;">
							<text class="label-content">备注</text>
							<text
								style="flex: 1; font-size: 28rpx;color: #666666;">{{formData.enterpriseContent || '-'}}</text>
						</view>
						<u-line></u-line>
						<template v-if="formData.enterpriseTaskItemDtoList.length > 0">
							<view class="top" style="padding-top: 20rpx;">
								<text class="label-content">检查事项</text>
								<text style="flex: 1; font-size: 28rpx;color: #666666;"></text>
							</view>
							<view class="file-content">
								<view class="item" v-for="(item,index) in formData.enterpriseTaskItemDtoList"
									:key="index">
									<text>{{(index + 1) + '，'}}</text>
									<text class="txt">{{item.itemName}}</text>
									<view @click="toMattersDetail(item)">
										<u-icon name="arrow-right" color="#323232" size="18"></u-icon>
									</view>
								</view>
							</view>
							<u-line></u-line>
						</template>

					</view>
				</view>
			</view>


		</scroll-view>
	</view>
</template>

<script>
	import store from '@/store'
	import config from '@/api/config'
	let App = getApp();
	export default {
		components: {},
		data() {
			return {
				showKnown: false,
				showLoading: false,
				loadingTips: '上传中...',
				isCreatOver: true,
				showEndTime: false,
				showStartTime: false,
				statusHeight: 44 + App.globalData.statusBarHeight,
				titleStyle: {
					color: "#ffffff",
					fontWeight: "bold",
					fontSize: "18px"
				},
				formData: {
					taskName: "",
					taskTypeCode: "",
					taskTypeName: "",
					numbers: "",
					enterpriseContent: "",
					enterpriseTaskItemDtoList: [],
					enterprisePlanDate: "",
					planStartTime: "",
					planEndTime: "",
				},
				showType: false,
				actions: [],
				inCompanyList: [],
				creditCompanyVo: null,
				sysUser: null,
				userId: store.state.user.USER_OPENID,
				socialCreditNumber: "",
				startTime: "",
				overTime: "",
				fileList: [],
				dataParams: null,
			};
		},
		watch: {
			inCompanyList: {
				handler(value) {
					this.formData.numbers = value.length
				},
				immediate: true,
				deep: true
			}
		},
		onLoad(options) {
			let taskInfo = JSON.parse(uni.getStorageSync('taskInfo'))
			console.log(taskInfo, '&&&&&&&&&&&&&&&&&&&&&&&&&&&')
			this.formData.taskName = taskInfo.taskName || ''
			this.formData.taskTypeCode = taskInfo.taskTypeCode || ''
			this.formData.taskTypeName = taskInfo.taskTypeName || ''
			this.formData.enterpriseContent = taskInfo.enterpriseContent || ''
			this.formData.enterpriseTaskItemDtoList = taskInfo.enterpriseTaskItemDtoList
			this.formData.enterprisePlanDate = taskInfo.enterprisePlanDate || ''
			this.creditCompanyVo = taskInfo

			this.inCompanyList = taskInfo.taskPersonnelList || []
		},
		methods: {
			/* 跳转入企事项详情 */
			toMattersDetail(item) {
				console.log(item)
				uni.navigateTo({
					url: '/pages-mall/pages/matters/detail?itemSubLists=' + item.itemStr
				})
			},
		}
	};
</script>

<style lang="scss" scoped>
	.warp {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
	}

	

	.custom-button {
		width: 160rpx;
		height: 54rpx;
		font-size: 24rpx;
		color: #fff;
		background: #3c9cff;
		border-radius: 6px;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.scroll-view_H {
		width: 100%;
		height: 100%;

		.file-content {
			.item {
				font-size: 24rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 12rpx 14rpx;
				border-radius: 8rpx;
				border: 1px solid #eee;
				margin-bottom: 10rpx;

				.txt {
					flex: 1;
					overflow: hidden;
					/*内容超出后隐藏*/
					text-overflow: ellipsis;
					/*超出内容显示为省略号*/
					white-space: nowrap;
					/*文本不进行换行*/
				}
			}
		}



		.matters-content {
			width: 100%;
			margin-top: 12rpx;
			display: flex;
			flex-direction: column;

			.item {
				font-size: 26rpx;
				display: flex;
				align-items: center;
				padding: 12rpx 14rpx;
				border-radius: 8rpx;
				border: 1px solid #eee;
				margin-bottom: 10rpx;

				.txt {
					flex: 1;
					overflow: hidden;
					/*内容超出后隐藏*/
					text-overflow: ellipsis;
					/*超出内容显示为省略号*/
					white-space: nowrap;
					/*文本不进行换行*/
				}
			}
		}

		.submit-content {
			padding: 30rpx;
			height: 200rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
		}

		.other-staff {
			height: 80rpx;
			border: 1px dashed #1169DB;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 32rpx;
			color: #1169DB;
			font-weight: bold;
			margin: 0px 20rpx;
			border-radius: 6rpx;
		}

		.inCompany-task {
			display: flex;
			flex-direction: column;
			padding: 20rpx;


			.task-item {
				display: flex;
				align-items: center;
				padding: 20rpx 30rpx;
				background-color: #fff;
				border-radius: 12rpx;
				box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.15);

				.left {
					flex: 1;
					display: flex;
					flex-direction: column;

					.top {
						display: flex;
						align-items: center;
						padding-bottom: 20rpx;

						.clear-ico {
							padding: 10rpx;
						}

						.label-content {
							width: 90px;
							font-size: 28rpx;
							color: #323232;
							font-weight: bold;
						}
					}
				}
			}
		}



	}
</style>